package com.fujimana.rockincat.restree.log.jdk;

import java.util.logging.Level;

import com.fujimana.rockincat.restree.log.Logger;

public class JDKLogger implements Logger {

	private final java.util.logging.Logger logger;

	JDKLogger(String category) {
		this.logger = java.util.logging.Logger.getLogger(category);
	}

	@Override
	public void debug(String message) {
		logger.log(Level.FINE, message);
	}

	@Override
	public void debug(String message, Throwable t) {
		logger.log(Level.FINE, message, t);
	}

	@Override
	public void error(String message) {
		logger.log(Level.SEVERE, message);
	}

	@Override
	public void error(String message, Throwable t) {
		logger.log(Level.SEVERE, message, t);
	}

	@Override
	public void fatal(String message) {
		logger.log(Level.SEVERE, message);
	}

	@Override
	public void fatal(String message, Throwable t) {
		logger.log(Level.SEVERE, message, t);
	}

	@Override
	public void info(String message) {
		logger.log(Level.INFO, message);
	}

	@Override
	public void info(String message, Throwable t) {
		logger.log(Level.INFO, message, t);
	}

	@Override
	public boolean isDebugEnabled() {
		return logger.isLoggable(Level.FINE);
	}

	@Override
	public boolean isErrorEnabled() {
		return logger.isLoggable(Level.SEVERE);
	}

	@Override
	public boolean isFatalEnabled() {
		return logger.isLoggable(Level.SEVERE);
	}

	@Override
	public boolean isInfoEnabled() {
		return logger.isLoggable(Level.INFO);
	}

	@Override
	public boolean isTraceEnabled() {
		return logger.isLoggable(Level.FINE);
	}

	@Override
	public boolean isWarnEnabled() {
		return logger.isLoggable(Level.WARNING);
	}

	@Override
	public void trace(String message) {
		logger.log(Level.FINE, message);
	}

	@Override
	public void trace(String message, Throwable t) {
		logger.log(Level.FINE, message, t);
	}

	@Override
	public void warn(String message) {
		logger.log(Level.WARNING, message);
	}

	@Override
	public void warn(String message, Throwable t) {
		logger.log(Level.WARNING, message, t);
	}

}
